<template>
  <div class="menu">
    <div class="menu-title">
      <i class="el-icon-position">{{ title }}</i>
    </div>
    <div class="flex">
      <div
        class="menu-content"
        v-for="item in list"
        :key="item.id"
        @click="toDetailPage(item.id)"
      >
        <div class="left">
          <img :src="item.image" alt="" />
        </div>
        <div class="right">
          <h5>{{ item.title }}</h5>
          <div class="right-content">
            {{ item.desc }}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      required: true,
    },
    title: {
      required: true,
    },
  },
  methods: {
    toDetailPage(id) {
      console.log(40,id);
      if (this.title === "地产列表") {
        this.$router.push({
          path: "/estate/particulars",
          query: {
            id,
          },
        });
      }
    },
  },
};
</script>

<style lang="less" scoped>
.menu {
  // padding-bottom: 200px;
  width: 1000px;
  margin: 20px auto;
}
.menu-title {
  padding: 10px 0;
  color: orange;
}
.flex {
  display: flex;
  flex-wrap: wrap;
}
.menu-content {
  background-color: #fff;
  margin: 10px;
  width: 31%;
  display: flex;
  flex-direction: column;
  text-align: center;
  // border: 1px solid #ccc;
  &:hover {
    // scale: (1.1);
    box-shadow: 3px 2px 5px 2px #ccc;
  }
  .left {
    img {
      // width: 140px;
      height: 150px;
      padding: 5px 10px;
    }
  }
  .right {
    // border-left: 1px solid #ccc;
    flex: 1;
    padding: 5px 10px;
    h5 {
      text-align: center;
      font-weight: 700;
      line-height: 30px;
    }
  }
}
</style>